<template>
  <transition>
    <div class="purchase-container">
      <div class="purchase-content">
        <div class="title">
          <h1>Hi, <span>{{real_name}}</span></h1>
          <p>请选择一家门店去采购吧</p>
        </div>

        <div class="store-item" v-for="shop in shops" :key="shop.shop_id" @click="goList">
          <div class="store-name">
            <img src="" alt="">
            <span>{{shop.shop_name}}</span>
          </div>
          <p class="store-adress store-common ellipsis">
            <img src="@/assets/images/定位.png" alt="">
            <span>武汉市洪山区鲁巷光谷地铁站b出口麦当劳楼上7楼706室</span>
          </p>
          <p class="store-phone store-common">
            <img src="@/assets/images/电话.png" alt="">
            <span>{{shop.shop_phone}}</span>
          </p>
          <p class="gochase">去采购></p>
        </div>

      </div>

    </div>
  </transition>

</template>

<script>
import { mapGetters } from 'vuex';
export default {
  created(){
    console.log(this.shops)
  },
  methods:{
    goList(){
      this.$router.push({path: '/supply/purchase/goodslist'});
    }
  },
  computed: {
    ...mapGetters([
      'shops',
      "real_name"
    ])
  }
}
</script>

<style lang="scss" scoped>
.purchase-container {
  width: 100%;
  height: 100vh;
  background-color: #36acda;
  padding-top: 3rem;
  .purchase-content {
    padding: 0.8rem;
    .title {
      h1 {
        font-size: 26px;
        color: #fff;
        font-weight: bold;
        span {
          font-size: 18px;
          font-weight: bold;
        }
      }
      p {
        margin-top: 0.5rem;
        color: #fff;
        font-size: 16px;
      }
    }
    .store-item {
      background-color: #fff;
      margin-top: 1.5rem;
      border-radius: 5px;
      padding: 1rem;
      .store-name {
        margin-bottom: 0.8rem;
        span {
          font-size: 18px;
        }
      }
      p {
        font-size: 14px;
        margin-top: 0.5rem;
        &.store-common {
          padding: 0 1.2rem 0 0.2rem;
        }
        img {
          width: 15px;
          position: relative;
          top: 2px;
        }
        span {
          margin-left: 3px;
        }
        &.gochase {
          text-align: right;
          color: #36acda;
        }
      }
    }
  }
}
</style>
